<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <title>成都家政服务系统</title>
    <!-- Bootstrap core CSS -->
    <link href="{{asset('layui/css/layui.css')}}" rel="stylesheet" media="all">
    <link rel="stylesheet" href="{{asset('bootstrap/css/bootstrap.min.css')}}">
    <link rel="stylesheet" href="{{asset('bootstrap/css/dashboard.css')}}">
    <link rel="stylesheet" href="{{asset('bootstrap/css/bootstrap-theme.min.css')}}">
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="{{asset('layui/layui.js')}}" charset="utf-8"></script>
    <script src="{{asset('jquery.js')}}"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="{{asset('bootstrap/js/bootstrap.min.js')}}"></script>
</head>
<body>

<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">成都家政服务系统</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">成都家政服务系统</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="javascript:;">{{session("employee_name")}}，欢迎您</a></li>
                <li><a href="javascript:;">职位：{{session("employee_power")}}</a></li>
                <li><a href="/adminLogout" style="color: red">退出</a></li>
            </ul>
        </div>
    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-2 sidebar">
            <ul class="nav nav-sidebar">
                <li><a href="javascript:;" style="background-color: lightgrey"><h4><strong>人员</strong></h4></a></li>
                <li><a href="/areaMaster.searchEmployee">查看员工</a></li>
                <li><a href="/areaMaster.checkEmployee">审核申请</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li><a href="javascript:;" style="background-color: lightgrey"><h4><strong>任务</strong></h4></a></li>
                <li  class="active"><a href="/areaMaster.searchTask">任务管理</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li><a href="javascript:;" style="background-color: lightgrey"><h4><strong>财务</strong></h4></a></li>
                <li><a href="/areaMaster.searchMoney">财务统计</a></li>
            </ul>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h2 class="page-header">当前任务：{{$nowTask->task_name}}</h2>
            @if(session('__Ajax_RedirectFunc_status') == true)
                <div>
                    <div class="alert alert-success alert-dismissible fade in" role="alert">
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h3>成功</h3>
                        <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
                        <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
                    </div>
                </div>
            @endif
            @if(session('__Ajax_RedirectFunc_status') === false)
                <div >
                    <div class="alert alert-danger alert-dismissible fade in" role="alert">
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <h3>失败</h3>
                        <p><?php echo session('__Ajax_RedirectFunc_message');?></p>
                        <p><?php echo session('__Ajax_RedirectFunc_plugin');?></p>
                    </div>
                </div>
            @endif
            <div class="panel-body" >
                <div class="col-md-8" >
                    <h4>发布日期：{{$nowTask->task_time}}</h4>
                    <br>
                    <h4>任务说明：{{$nowTask->task_info}}</h4>
                    <br>
                    <h4>任务酬劳：{{$nowTask->task_money}}</h4>
                    <br>
                    <h4>任务联系人：{{$nowTask->task_people}}</h4>
                    <br>
                    <h4>任务联系方式：{{$nowTask->task_phone}}</h4>
                </div>
                <div class="col-md-4 well">
                    <h3>领取人：{{$employee_name}}</h3>
                    <br>
                    <h3>联系方式：{{$employee_phone}}</h3>
                    <br>
                    @if($employee_name == '暂无')
                        <a href="" type="button" class="btn btn-primary btn-block  btn-sm disabled" >进入领取人主页</a>
                    @endif
                    @if($employee_name != '暂无')
                        <a href="" type="button" class="btn btn-primary btn-block  btn-sm " >进入领取人主页</a>
                    @endif
                    <hr>
                    @if($employee_name == '暂无')
                        <div class="form-group">
                            <div class="form-group">
                                <h4>指派任务：</h4>
                            </div>
                            <div class="form-group">
                                <form action="/areaMaster.taskToEmployee" method="post">
                                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                    <input type="hidden" name="task_id" value="{{$nowTask->task_id}}">
                                    <select name="employee_id" class="form-control">
                                        @foreach($employeeData as $data)
                                            <option value="{{$data->employee_id}}">{{$data->employee_id}}：{{$data->employee_name}}</option>
                                        @endforeach
                                    </select>
                                    <br>
                                    <button  type="submit" class="btn btn-primary btn-block btn-sm" >确认指派</button>
                                </form>
                            </div>
                        </div>
                    @endif
                </div>
                <hr>
                <div class="panel panel-default">
                    <div class="panel-body">

                            <h4>任务评价：@if($employee_name == '暂无') 暂无 @endif</h4>
                                @if($employee_name != '暂无')
                            <hr>
                            <table class="table table-bordered table-responsive table-striped table-hover">
                                <thead>
                                <tr>
                                    <th>评价时间</th>
                                    <th>客户</th>
                                    <th>内容</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($evaluationData as $data)
                                    <tr>
                                        <td scope="row">{{$data->evaluation_time}}</td>
                                        <td>{{$data->customer_name}}</td>
                                        <td>{{$data->evaluation_info}}</td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            @endif
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>